import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';

// 引入cookie
import cookie from 'react-cookies'

// 引入UI框架
import * as Vant from 'react-vant'
import * as icon from '@react-vant/icons'

// 引入路由
import * as Router from 'react-router-dom'

// 引入接口
import API from '@/api/index'

// 挂载全局自定义属性
React.$Vant = Vant
React.$Icon = icon
React.$Router = Router
React.$Cookie = cookie
React.$Api = API

// 将登录信息做成一个React全局属性
React.$LoginUser = cookie.load('LoginUser') ? cookie.load('LoginUser') : {}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  // <React.StrictMode>
    <App />
  // </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
